passing ISNULL value
hello [img]style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":unsure:" border="0" alt="unsure.gif" />
i have sql query
SELECT ID, sNumber, dbo.studentNameFromID(ID) AS fullName, dbo.sexName(sSex) AS sSex, sAge, sTel, sMobile, dbo.addressFromID(sAddress_ID) AS aAddress, dbo.studentBalanceAll(ID)
AS _balance
FROM student
WHERE (ID = ISNULL(@student_ID, ID)) AND (sSex = ISNULL(@sSex, sSex)) AND (sAddress_ID = ISNULL(@sAddress, sAddress_ID))
when i pass @student_ID=3 its works correctly and i get me one student , but i want pass DBNull.Value to give me all students
how i can pass DBNull value to parameter ?
thanks alot[/img]
Comments
FROM student
WHERE (ID = @student_ID OR @student_ID IS NULL)
why i should add two parameters one to sql query and another parameter to parameters to get a result.
https://drive.google.com/file/d/1p6A4qyGo4i...iew?usp=sharing
https://drive.google.com/file/d/1hQ7hlvq1-o...iew?usp=sharing
thanks
'SelectCommand' is linked to 'commandparameter' then 'commandparameter' is linked to 'Parameter'
that is fastreport's logic